<%
 String name   = request.getParameter("cardnumber");
 String pass   = request.getParameter("pin");
 System.out.println(name);
%>

<%
 if(name.equals("public"))
  {
     if(pass.equals("public"))
         {
         %>
         <script>
             alert("You are logged in now!");
             window.location="user_index.jsp";
         </script>

            <%
         }
     else
      {
         %>
         <script type="text/javascript">
            alert("Enter Correct Card Number or PIN");
            window.location="login.jsp";
         </script>
         <%
      }
  }
 else if(name.equals("admin"))
  {
     if(pass.equals("admin"))
         {
            %>
         <script>
             alert("You are logged in ");
             window.location="admin_index.jsp";
         </script>

            <%
         }
     else
      {
          %>
         <script type="text/javascript">
            alert("Enter Correct user name or password");
            window.location="login.jsp";
         </script>
         <%
      }
  }
 else
  {
         %>
         <script type="text/javascript">
            alert("Enter Correct user name or password");
            window.location="login.jsp";
         </script>
         <%
  }
%>